-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: bump kubernetes- and openshift-client to 7.0.0 (#247) #248
Conversation
kubernetes-client 7.0 was released: https://repo1.maven.org/maven2/io/fabric8/kubernetes-client/7.0.0/ |
6482dba
to
ce7e878
Compare
weird enough tests only fail when run on IC-2024.2... |
@@ -38,30 +38,22 @@ public class ConfigWatcher implements Runnable { | |||
private WatchService service; | |||
|
|||
public interface Listener { | |||
void onUpdate(ConfigWatcher source, Config config); | |||
void onUpdate(Config updatedConfig); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ConfigWatcher
now notifies changes in the client config (which is the result of merging all config files)
public ConfigWatcher(String config, Listener listener) { | ||
this(Paths.get(config), listener); | ||
public ConfigWatcher(Listener listener) { | ||
this(Config.getKubeconfigFilenames().stream().map(Paths::get).toList(), listener, new HighSensitivityRegistrar()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ConfigWatcher
does not need to get the path to the config file. It is using the Client config which merged all the config files that were merged when it (auto-) configured
One could have provided ConfigWatcher
with a list of paths instead of it relying on kubernetes-client class Config
(avoiding this dependency). But the client Config
is the class that is notified in case of changes in any of the kubeconfs. So there's no "avoiding" it.
this.configs = configs; | ||
this.listener = listener; | ||
this.registrar = registrar; | ||
} | ||
|
||
@Override | ||
public void run() { | ||
watch((Config config) -> listener.onUpdate(this, config)); | ||
watch(listener::onUpdate); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
notify listeners of a change in the client config (not individual kubeconf files)
@@ -70,11 +62,11 @@ public void close() throws IOException { | |||
} | |||
} | |||
|
|||
private void watch(Consumer<Config> consumer) { | |||
private void watch(Consumer<Config> listener) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
simple rename, "listener" is more precise.
for (WatchKey key = service.take(); key != null; key = service.take()) { | ||
key.pollEvents().forEach((event) -> { | ||
Path changed = getAbsolutePath(directory, (Path) event.context()); | ||
if (isConfigPath(changed)) { | ||
consumer.accept(loadConfig(changed)); | ||
Config config = new ConfigBuilder().build(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dont load a particular kubeconf. Have the kubernetes-client load and merge all the files that are configured.
* Contributors: | ||
* Red Hat, Inc. - initial API and implementation | ||
******************************************************************************/ | ||
package com.redhat.devtools.intellij.common.utils; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moved methods that deal with the tools config in ConfigHelper
to a new class ToolsConfigHelper
. ConfigHelper
now onlay has methods that deal with the kubernernetes-client config.
@sbouchet: added comments explaining why I introduced a change |
Bumping mockito to 5.2.0 fixes the issue Didnt find out why Caused by:
java.lang.IllegalArgumentException: Java 21 (65) is not supported by the current version of Byte Buddy which officially supports Java 19 (63) - update Byte Buddy or set net.bytebuddy.experimental as a VM property
at net.bytebuddy.utility.OpenedClassReader.of(OpenedClassReader.java:96) Mockito 5.2.0 includes a version of the byte buddy that supports |
23fa60c
to
5ced17e
Compare
4233ac8
to
4b9fe5c
Compare
@sbouchet: This PR for intellij-common is ready. Please review. |
0afd96d
to
347244a
Compare
@@ -3,7 +3,7 @@ nexusUser=invalid | |||
nexusPassword=invalid | |||
|
|||
# IntelliJ Platform Properties -> https://plugins.jetbrains.com/docs/intellij/tools-gradle-intellij-plugin.html#configuration-intellij-extension | |||
ideaVersion=2024.2 | |||
ideaVersion=2024.3 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please also update the ci to validate against this version ( i know it's this one used in OS-matrix build, but this will provide us verifier reports )
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
beside ci workflow update that can be done in anoher PR, LGTM.
* changed API for ConfigWatcher#Listener#onUpdate * removed references to specific config file, use files collected by client instead * bumped mockito to support jdk21 Signed-off-by: Andre Dietisheim <[email protected]>
Quality Gate passedIssues Measures |
fixes #247